import request from "@/utils/request";
import { stringify } from "qs";
import { toFormData } from "@/utils/utils.jsx";

// 入库单列表
export async function getProductinboundorderList(params) {
	return request(`/new-wms/productinboundorder/select-purchase-order-page`, {
		method: "Post",
		data: params,
		loading: true
	});
}
// 手动创建商品入库单
export async function productinboundorderCreateProductOrder(params) {
	return request(`/new-wms/productinboundorder/create-product-inboundorder`, {
		method: "post",
		data: params,
		loading: true
	});
}

// 商品详情
export async function productinboundorderDetail(params) {
	return request(`/new-wms/productinboundorder/select-es-product-inbound-order-detail?${stringify(params)}`, {
		loading: true
	});
}
// 作废入库单
export async function productinboundorderCancelled(params) {
	return request(`/new-wms/productinboundorder/cancelled`, {
		method: "post",
		data: params,
		loading: true
	});
}

// 强制完成
export async function productinboundorderForcedComplete(params) {
	return request(`/new-wms/productinboundorder/forced-complete`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 新增商品列表
export async function getGoodsSkuPage(params) {
	return request(`/new-goods/goods/sku/list`, {
        method: "Post",
		data: params,
		loading: true
	});
}
// 设置入仓

export async function setProductinboundorderEntry(params) {
	return request(`/new-wms/productinboundorder/set-warehouse-entry`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 仓库列表
export async function getWarehouseList(params={}) {
	return request(`/new-wms/inventory/warehouse-list`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 日志
export async function getLogsPage(params) {
	return request(`/new-wms/logs/page?${stringify(params)}`, { loading: true });
}
// 拿货员列表
export async function queryTakeUserList(params) {
	return request(`/blade-user/childUsers?${stringify(params)}`, { loading: true });
}

// 打印入库单请求
export async function productinboundorderPrint(params) {
	return request(`/new-wms/productinboundorder/print`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 打印成功后请求
export async function printSuccessNotify(params) {
	return request(`/new-wms/productinboundorder/inbound-order-print-success-notify`, {
		method: "post",
		data: params
		// loading: true
	});
}

//获取快麦打印数据
export async function getInboundOrderPrintData(params) {
	return request(`/new-wms/kuaimai/getInboundOrderPrintData`, {
		method: "post",
		data: params
	});
}

// 获取入库单模板列表
export async function queryLabelTemplate(params) {
	return request(`/new-common/labelTemplate/list`, {
		method: "post",
		data: params,
	});
}
